<?php use_stylesheet('tasks.css') ?>
<!--h1>Tasks List</h1-->
<div id="tasks">
  <?php foreach ($milestones as $milestone): ?>
    <div class="milestone_<?php echo SmartManager::slugify($milestone->getName()) ?>">
      <div class="milestone">        
        <h2 style="background-color:#FFCC66">milestone: <a href="milestone/show/milestoneid/<?php echo $milestone->getMilestoneid() ?>"><?php echo $milestone ?></a></h2>                
      </div>
      <?php include_partial('task/list', array('tasks' => $milestone->getTasks(sfConfig::get('app_max_tasks_to_show')))) ?> 
      <?php if (($count = $milestone->countTasks() - sfConfig::get('app_max_tasks_to_show')) > 0): ?>
        <div class="more_tasks">
          and <a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid())?>"><?php echo $count ?></a>
          more...
        </div>
      <?php endif; ?>
    </div>
  <?php endforeach; ?>
</div>
<a href="<?php echo url_for('task/new') ?>">New</a>
